#include "useritem.h"

#include "ui_useritem.h"

#include <CommonUtils.h>

UserItem::UserItem(QWidget* parent) : QWidget(parent),
                                      ui(new Ui::UserItem) {
    ui->setupUi(this);
}

UserItem::~UserItem() {
    delete ui;
}

void UserItem::setPixmap(QString path) {
    ui->label_head->setHeadshot(path);
}

void UserItem::setName(QString name) {
    ui->label_name->setText(name);
}

void UserItem::setSign(QString message) {
    ui->label_sgin->setText(message);
}

void UserItem::setOnlineStatus(bool statu) {
    if (statu) {
        ui->label_online_staus->setText("在线");
    }
    else {
        ui->label_online_staus->setText("离线线");
    }
}

QString UserItem::getName() const {
    return ui->label_name->text();
}

QString UserItem::getUserId() const {
    return userId;
}

void UserItem::setUserId(QString userId) {
    this->userId = userId;
}
